﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AuthorityRoleList.aspx.cs" Inherits="OpSystem.Manage.authority.AuthorityRoleList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!-- #include file="~/include/header.html" -->
</head>
<body>
    <form id="form1" runat="server">
        <section class="content-header">
            <h1>角色管理
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i>主页</a></li>
                <li class="active">角色管理</li>
            </ol>
        </section>
        <section class="content">
            <div class="row">
                <div class="col-md-12">
                    <div class="box box-primary">
                        <div class="box-header">
                            
                                    <button class="btnadd btn btn-success btn-sm" id="addbtn" type="button">添加角色</button></li>
                            
                        </div>
                        <div class="box-body table-responsive no-padding">
                            <table class="table table-hover body-table-head">
                                <colgroup>
                                    <col style="width: 100px" />
                                    <col style="width: 300px" />
                                    <col style="width: 100px" />
                                </colgroup>
                                <tbody>
                                    <tr>
                                        <th>ID</th>
                                        <th>名称</th>
                                        <th class="t_c">操作</th>
                                    </tr>
                                    <asp:Repeater runat="server" ID="rptList">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    <%# Eval("RoleID") %>
                                                </td>
                                                <td>
                                                    <%# Eval("RoleName") %>
                                                </td>
                                                <td class="t_c">
                                                    <button type="button" class="btn btn-info btn-xs" onclick="edit('<%# Eval("RoleID")%>')">修改</button>
                                                    <button type="button" class="btn btn-warning btn-xs" onclick="config('<%# Eval("RoleID")%>')">配置权限</button>
                                                    <button type="button" class="btn btn-danger btn-xs" onclick="del('<%# Eval("RoleID")%>')">删除</button>
                                                </td>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <tr style='display: <%#bool.Parse((rptList.Items.Count==0).ToString())==true?"":"none"%>'>
                                                <td colspan="3" style="text-align: center">
                                                    <div class="no-data">
                                                        <div class="img-box"></div>
                                                        <div class="text">暂无数据</div>
                                                    </div>
                                                </td>
                                            </tr>
                                        </FooterTemplate>
                                    </asp:Repeater>
                                </tbody>
                            </table>
                        </div>
                        <div class="box-footer clearfix ">
                                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" showinputbox="Never" CssClass="pagination pagination-sm no-margin pull-right"
                                    PageSize="10" OnPageChanged="AspNetPager1_PageChanged" LayoutType="Ul"
                                    PagingButtonLayoutType="UnorderedList" PagingButtonSpacing="0" CurrentPageButtonClass="active">
                                </webdiyer:AspNetPager>

                            </div>
                    </div>
                </div>
            </div>
        </section>
    </form>
    <!-- #include file="~/include/footer.html" -->
    <script type="text/javascript">
        $("#addbtn").click(function () {
            var sysid = $("#ddlSystem").val();
            if (sysid == 0) {
                BMCW.alert("请选择系统");
                return;
            }
            var url = '<%=GetPageUrl("AuthorityRoleEdit.aspx")%>';
            BMCW.showTopLayer('添加角色', url, 550, 400);
        });

        function edit(rid) {
            var url = '<%=GetPageUrl("AuthorityRoleEdit.aspx")%>?id=' + rid;
            BMCW.showTopLayer('修改角色', url, 600, 400);
        }

        function config(rid) {
            var url = '<%=GetPageUrl("AuthorityRoleMenuRelaEdit.aspx")%>?&id='+rid;
            BMCW.showTopLayer('配置权限', url, 800, 600);
        }

        function del(rid) {
            var url = '<%=GetPageUrl("AuthorityRoleList.aspx")%>';
            BMCW.DataConfirmMaskDel('delrole',rid, '', url, true);
        }
    </script>
</body>
</html>
